home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: MegaDisc
/
MegaDisc 27 (1992-03)(MegaDisc Digital Publishing)(AU)(Disk 2 of 2).zip
/
MegaDisc 27 (1992-03)(MegaDisc Digital Publishing)(AU)(Disk 2 of 2).adf
/
Programming
/
Basic_Routines
/
BasicSubs
/
Utilities
/
AboutChangePalette
< prev
next >
Wrap
Text File
|
1992-03-30
|
3KB
|
63 lines
ABOUT CHANGEPALETTE
(( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 ))
I do most of my programming on a hi-res screen using 16 colours by choice
or 8 when I am forced into it by memory constraints. Because I am aiming
my programming at young children, I like a lot of strong, different
colours - and I don't particularly fancy the preset colours that come up
when you set up a screen with this number of colours. At first, I would
set up each program with its own set of palette statements, with the
values stored in a DATA statement. Very soon, however, I decided to write
a simple subroutine to load a set of colours from a text file into
memory. That subroutine, LOADCOLOURS, appears in the Subroutines drawer.
However, to maintain this text file, I needed to write a utility to
control the colours of my preset palette. So I wrote ChangePalette (CP).
The main functions of CP are fairly obvious. On screen is shown the first
colour in the palette, its name and RGB values. You can scroll through
the 16 colours stored, modify the values or names of any of them and see
the result immediately in the display area. Any changes can be reset,
either individual colours or the whole set. Finally, there are save and
quit options.
The only things about the program that are not self explanatory are:
1. That the RGB fields expect a numeric value between 0 and 1 - all
other keys or values will be rejected. These values are consistent
with the form required by AmigaBASIC.
2. When entering data in either the name field or any of the RGB numeric
fields, hitting the <ESC> key will abort the colour modification.
Hitting the <RET> key at the first character will accept the preset
for that field.
The program uses a number of subroutines presented in BasicUtils&Subs.
These include RAISED, GETINPUT and GETNUMBER, as well as a modified
version of LOADCOLOURS.
It would be possible to modify the entry of RGB data using a slider
instead of numeric input fields. I have chosen the latter as I like to be
able to see the values I have put in rather than guess by the position of
the slider. This allows me to make exact modifications to give a
particular colour - the BASIC manual gives figures for 16 colours in its
explanation of the PALETTE command. It would also be possible to remove
the Modify key altogether and simply click on the field to be modified
(as in Ltd_Input.demo). However, my own personal preference is to work on
the full values of any one colour at a time.
I generally put CP on all my program discs along with the text files that
it controls (Colours and Orig.Colours in the SetupFiles drawer) so that I
can modify the palette for any series of programs.
(( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 ))